export default {
  data() {
    return {
      // 权限列表信息
      rightsList: []
    }
  },
  created() {
    this.getRightsList()
  },
  methods: {
    async getRightsList() {
      const { data: res } = await this.$http.get('rights/list')
      if (res.meta.status !== 200) {
        return this.$message({
          message: '获取权限列表失败！',
          type: 'error',
          duration: 1000
        })
      }

      // 把获得的权限列表信息赋予给rightsList表格对象
      this.rightsList = res.data
    }
  }
}
